#ifndef CGCOLORBUFFER_H
#define CGCOLORBUFFER_H
#include <vector>
#include "cgcolor.h"

class CgColorBuffer {
public:
    CgColorBuffer(int width, int height) : width_(width), height_(height) { colors_.resize(width*height); }
    ~CgColorBuffer() {  }
    void setColor(int i, int j, const CgColor &c) { colors_[i*width_ + j] = c; }
    CgColor getColor(int i, int j) const { return colors_[i*width_ + j]; }
private:
    int width_, height_;
    std::vector<CgColor> colors_;
};

#endif // CGCOLORBUFFER_H
